package com.cleaningcloud.cld.service.impl.mini;

import com.cleaningcloud.cld.domain.vo.CldEvaluateVo;
import com.cleaningcloud.cld.domain.vo.CldRevisitVo;
import com.cleaningcloud.cld.mapper.CldRevisitMapper;
import com.cleaningcloud.cld.service.mini.IMiniRevisitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * packageName com.cleaningcloud.cld.service.impl.mini
 *
 * @author Shaw
 * @version JDK 8
 * @className MiniRevisitServiceImpl
 * @date 2025-06-18
 * @description 小程序(客户端)-客户回访
 */
@Service
public class MiniRevisitServiceImpl implements IMiniRevisitService {

    @Autowired
    CldRevisitMapper cldRevisitMapper;

    /**
     * @Author Shaw
     * @Description 查询客户回访列表信息
     * @date: 2025-06-20 15:47
     * @param: //TODO
     */
    @Override
    public List<CldRevisitVo> getCldRevisitList(CldRevisitVo cldEvaluateVo){
        return cldRevisitMapper.selectCldRevisitList(cldEvaluateVo);
    }

    /**
     * @Author Shaw
     * @Description 查询客户回访详情信息
     * @date: 2025-06-20 15:47
     * @param: //TODO
     */
    public CldRevisitVo getCldRevisitInfo(Long revisitId){
        return cldRevisitMapper.selectCldRevisitByRevisitId(revisitId);
    }

    /**
     * @Author Shaw
     * @Description 客户回访评价
     * @date: 2025-06-20 15:47
     * @param: //TODO
     */
    public int updateEvaluate(CldRevisitVo cldEvaluateVo){
        CldRevisitVo obj = cldRevisitMapper.selectCldRevisitByRevisitId(cldEvaluateVo.getRevisitId());
        obj.setRevisitEvaluate(cldEvaluateVo.getRevisitEvaluate());
        obj.setRevisitEvaluatePersonId(cldEvaluateVo.getRevisitEvaluatePersonId());
        obj.setRevisitEvaluatePersonName(cldEvaluateVo.getRevisitEvaluatePersonName());
        return cldRevisitMapper.updateCldRevisit(obj);
    }
}